class User
	include Mongoid::Document

	field :first_name, :type => String
	field :last_name, :type => String
	field :username, :type => String
	field :password, :type =>String

	validates_length_of :password, :maximum => 15, :minimum => 6
	validates :first_name, :last_name, :username, :password, :presence => true 

	index :username, unique: true

	has_many :blog_posts

end